﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FAP.DataAccess.BLL;

namespace FAP.DataAccess
{
    public class DanhMucDAO
    {
        private static FAPDataContext m_context;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="strTag"></param>
        /// <returns></returns>
        public static List<danhmuc> SearchByTag(string strTag)
        {
            m_context = new FAPDataContext();
            var lstDM = new List<danhmuc>();
            if (strTag == "")
                lstDM = (from dm in m_context.danhmucs select dm).ToList();
            else
                lstDM = m_context.danhmucs.Where(dm => dm.tag.Contains(strTag)).ToList();              
            return lstDM;
        }



    }
}
